<?php
/**
 * add this view, should
 * 1) get event list
 * 2) show event list
 * 3) if click addEvent button, add new event
 * 4) if click on one event, can modify event
 * 
 */
//get active app
$app = Blyn::app()->getActiveApp();
$control=  Blyn::app()->getUIManager();
$screen = Blyn::app()->getUIManager()->getCurrentScreen();
$model=new ImageFormModel();
?>

<h3>Image-Upload</h3>
<div class="form">
    
    <?php echo CHtml::form('','post',array('enctype'=>'multipart/form-data'));?>
    
        <div class="row">
            <?php echo CHtml::activeLabel($model,'url'); ?>
            <?php echo CHtml::activeTextField($model,'url',array('value'=>'只是普通的文本框')) ?>
        </div>
        <div class="row">
            <?php echo CHtml::activeLabel($model,'image'); ?>
            <?php echo CHtml::activeFileField($model, 'image');?>
        </div>
        <div class="row submit">
            <p>如果使用下面这个按钮可以保存图片到upload目录</p>
            <?php echo CHtml::submitButton('Submit'); ?>
            <p>使用下面这个按钮可以保存url，但是不能保存图片</p>
            <?php echo $control->getAjaxLink(array('name' => 'GetAjaxLink', 'id' => 'SaveImage'), array('htmlOptions' => array('class' => 'btn', 'enctype' => 'multipart/form-data')));?>
        </div>

    <?php echo CHtml::endForm();?>
</div>



